package com.wyp168.leetcode.stack;

import java.util.*;

/**
 * @ClassName FreqStack
 * @Title TODO  设计一个能弹出最大频率元素的栈结构
 * @Description TODO
 * @Author wyp168
 * @Date 2022/11/30 23:00
 */
public class FreqStack {

    Deque<Integer> stack;

    Map<Integer, Integer> map = new HashMap<>();

    public FreqStack() {
        stack = new ArrayDeque<>();
    }

    public void push(int val) {
        map.put(val, map.getOrDefault(val, 0) + 1);
    }

//    public int pop() {
//
//    }
}

/**
 * Your FreqStack object will be instantiated and called as such:
 * FreqStack obj = new FreqStack();
 * obj.push(val); * int param_2 = obj.pop();
 */
